<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/view/head.html"/>
<script type="text/javascript">
function getTableForm() {
	return document.getElementById('tableForm');
}
function optDelete() {
	if(Pn.checkedCount('ids')<=0) {
		alert("<@s.m 'error.checkRecord'/>");
		return;
	}
	if(!confirm("<@s.m 'global.confirm.delete'/>")) {
		return;
	}
	var f = getTableForm();
	f.action="delete";
	f.submit();
}

function optPriority() {
	var f = getTableForm();
	f.action="order";
	f.submit();
}

</script>
</head>
<body>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>: 操作员管理 - <@s.m "global.list"/></div>
	<form class="ropt">
		<input type="submit" value="<@s.m "global.add"/>" onclick="this.form.action='add';"/>
	</form>
	<form class="ropt" method="post">
	          关键字
	    <input type="text" name="name" value="${name!}" size="10"/>
	    <input type="hidden" name="type" value="${type!}"/>
	    <select name="enable"">
	    	<option value="">全部</option>
	    	<option value="true" <#if enable??><#if enable>selected="selected"</#if></#if>>启用</option>
	    	<option value="false" <#if enable??><#if !enable>selected="selected"</#if></#if>>禁用</option>
	    </select>
		<input type="submit" value="搜索" onclick="this.form.action='list';"/>
	</form>
	<div class="clear"></div>
</div>
<form id="tableForm" method="post">
<input type="hidden" name="pageNo" value="${pageNo!}"/>
<input type="hidden" name="type" value="${type!}"/>
<@p.table value=pagination;admin,i,has_next><#rt/>
	<@p.column title="<input type='checkbox' onclick='Pn.checkbox(\"ids\",this.checked)'/>" width="20">
		<input type='checkbox' name='ids' value='${admin.id}'/><#t/>
	</@p.column><#t/>
	<@p.column code="登录用户">${admin.user.username!}</@p.column><#t/>
	<@p.column code="姓名">${admin.user.realname!}</@p.column><#t/>
	<@p.column code="手机号">${admin.mobile!}</@p.column><#t/>
	<@p.column code="QQ">${admin.qq!}</@p.column><#t/>
	<@p.column code="状态" align="center"><#if admin.user.enable><span style="color:red">启用</span><#else>禁用</#if></@p.column><#t/>
	<@p.column code="global.operate" align="center">
		<a href="detail?id=${admin.id}" class="pn-opt">详情</a> | <#rt/>
		<a href="edit?id=${admin.id}&pageNo=${pageNo!}" class="pn-opt"><@s.m "global.edit"/></a><br/>
		<a href="delete?ids=${admin.id}&pageNo=${pageNo!}" onclick="if(!confirm('<@s.m "global.confirm.delete"/>')) {return false;}" class="pn-opt"><@s.m "global.delete"/></a> | <#t/>
		<a href="enable?ids=${admin.id}" class="pn-opt"><#if admin.user.enable>停止<#else><span style="color:red">开启</span></#if></a>
	</@p.column><#t/>
</@p.table>
<div>
	<input type="button" value="<@s.m "global.delete"/>" onclick="optDelete();"/>&nbsp; 
</div>
</form>
</div>
<#include "/common/alert_message.html"/>
</body>
</html>